package com.cencat.merchant.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.*;
import java.math.BigDecimal;

/**
 * 商家更新DTO
 * @author cencat
 * @since 2024-01-01
 */
@Data
@Schema(description = "商家更新DTO")
public class MerchantUpdateDTO {

    @Schema(description = "商家ID", required = true, example = "1")
    @NotNull(message = "商家ID不能为空")
    @Min(value = 1, message = "商家ID必须大于0")
    private Long id;

    @Schema(description = "商家名称", example = "张三的小店")
    @Size(min = 2, max = 100, message = "商家名称长度必须在2-100之间")
    private String merchantName;

    @Schema(description = "联系人姓名", example = "张三")
    @Size(min = 2, max = 50, message = "联系人姓名长度必须在2-50之间")
    private String contactName;

    @Schema(description = "联系电话", example = "13800138000")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String contactPhone;

    @Schema(description = "联系邮箱", example = "zhangsan@example.com")
    @Email(message = "邮箱格式不正确")
    @Size(max = 100, message = "邮箱长度不能超过100")
    private String contactEmail;

    @Schema(description = "商家地址", example = "北京市朝阳区xxx街道xxx号")
    @Size(max = 200, message = "商家地址长度不能超过200")
    private String address;

    @Schema(description = "商家描述", example = "专业提供优质商品和服务")
    @Size(max = 500, message = "商家描述长度不能超过500")
    private String description;

    @Schema(description = "营业执照号", example = "91110000000000000X")
    @Size(max = 50, message = "营业执照号长度不能超过50")
    private String businessLicense;

    @Schema(description = "法人代表", example = "张三")
    @Size(max = 50, message = "法人代表长度不能超过50")
    private String legalRepresentative;

    @Schema(description = "注册资本", example = "100000.00")
    @DecimalMin(value = "0.01", message = "注册资本必须大于0")
    @Digits(integer = 10, fraction = 2, message = "注册资本格式不正确")
    private BigDecimal registeredCapital;

    @Schema(description = "经营范围", example = "零售、批发")
    @Size(max = 500, message = "经营范围长度不能超过500")
    private String businessScope;

    @Schema(description = "商家网站", example = "https://www.example.com")
    @Size(max = 200, message = "商家网站长度不能超过200")
    private String website;

    @Schema(description = "商家Logo URL", example = "https://www.example.com/logo.png")
    @Size(max = 200, message = "Logo URL长度不能超过200")
    private String logoUrl;

    @Schema(description = "备注", example = "重要客户")
    @Size(max = 500, message = "备注长度不能超过500")
    private String remark;
}